package cn.qayy.service.impl;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.qayy.dao.WxClientMapper;
import cn.qayy.dto.ClientDTO;
import cn.qayy.po.WxClient;
import cn.qayy.service.IClientService;
import cn.qayy.utils.DownLoadUtil;

/***
 * @author wy
 *
 */
@SuppressWarnings("all")
@Service("clientServiceImpl")
public class ClientServiceImpl implements IClientService {

	@Resource
	public WxClientMapper wxClientMapper;

	@Override
	public PageInfo<WxClient> selectClientBy(Map<String, Object> params) throws Exception {
		ClientDTO dto = (ClientDTO)params.get("dto");
		DownLoadUtil.set("ClientDTO",params);
		PageHelper.startPage(dto.getPageNumber(), dto.getPageSize());
		List<WxClient> list = wxClientMapper.selectClientBy(params);
		PageInfo<WxClient> pageInfo = new PageInfo<WxClient>(list);
		return pageInfo;
	}

	
	@Override
	public int insertByList(List list) throws Exception {
		return wxClientMapper.insertByList(list);
	}

	@Override
	public int updateByList(List list) throws Exception {
		return wxClientMapper.updateByList(list);
	}

	@Override
	public int deleteByList(List list) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<ClientDTO> selectClientForDown(Map<String, Object> params) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WxClient selectClientByID(Integer gfId) throws Exception {
		return wxClientMapper.selectByPrimaryKey(gfId);
	}


	@Override
	public List<WxClient> selectByMap(Map<String, Object> params) {
		return wxClientMapper.selectByMap(params);
	}


	@Override
	public List<Integer> selectIdsByMap(Map<String, Object> params) {
		return wxClientMapper.selectIdsByMap(params);
	}


	@Override
	public List<Map<String,String>> selectClientAuto() {
		return wxClientMapper.selectClientAuto();
	}


	@Override
	public Collection<? extends Map<String, String>> selectClientUUID() {
		return wxClientMapper.selectClientUUID();
	}
}
